package com.ykj.controller;


import com.ykj.dto.Result;
import com.ykj.entity.Plate;
import com.ykj.service.PlateService;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 *  板块类型
 * </p>
 *
 * @author Y2014188432
 * @since 2022-05-07
 */
@RestController
@RequestMapping("/plate")
public class PlateController {

    @Resource
    private PlateService plateService;

    @GetMapping("/getHot")
    public Result getHot(){
        return plateService.getHot();
    }

    @GetMapping("/getById")
    public Result getById(String id){
        return Result.ok(plateService.getById(id));
    }

    @PostMapping("/create")
    public Result create(@RequestBody Plate plate){
        return plateService.create(plate);
    }

    @GetMapping("/getAll")
    public Result getAll(){
        return plateService.getAll();
    }

}

